/*============================================================================*/
/*                   CONTINENTAL AUTOMOTIVE SYSTEMS                           */
/*============================================================================*/
/*                        OBJECT SPECIFICATION                                */
/*============================================================================*
* name:            HAL_Led.h
* version:         1.0
* created_by:      Continental
* date_created:    June 7 2013
*=============================================================================*/
/* DESCRIPTION : Header file for abstraction layer for LED                    */
/*============================================================================*/
/* FUNCTION COMMENT : Header file abstraction layer for LED                   */
/*                                                                            */
/*============================================================================*/
/*                               OBJECT HISTORY                               */
/*============================================================================*/
/*  REVISION |   DATE      |                               |      AUTHOR      */
/*----------------------------------------------------------------------------*/
/*  1.0      | 07/jun/2013 |                               | Continental      */
/* Initial version for the Lab 2 using Freescale Bolero micro.                */
/*----------------------------------------------------------------------------*/
/*  2.0      | 22/jun/2013 |                               | Eunice Ibarra    */
/* Modified to use naming conventions						                  */
/*============================================================================*/

#ifndef HAL_LED_H                                /* To avoid double inclusion */
#define HAL_LED_H

/* Register definitions for selected microcontroller */
#include "MCU_derivative.h"

/*-- Defines -----------------------------------------------------------------*/

#define LED_WINDOW1       PIN_PE4
#define LED_WINDOW2       PIN_PE5
#define LED_WINDOW3       PIN_PE6
#define LED_WINDOW4       PIN_PE7
#define LED_WINDOW5       PIN_PE8
#define LED_WINDOW6       PIN_PE9
#define LED_WINDOW7       PIN_PE10
#define LED_WINDOW8       PIN_PE11
#define LED_WINDOW9       PIN_PE12
#define LED_WINDOW10      PIN_PE13
#define LED_WINDOW_UP     PIN_PE14
#define LED_WINDOW_DOWN   PIN_PE15

#define LED_ON            0
#define LED_OFF           1

#define LED_OPENED_WINDOW    (-1)
#define LED_CLOSED_WINDOW    (9)


/*-- Functions ---------------------------------------------------------------*/

void HAL_Led_InitChannel(T_UBYTE lub_Channel, T_UBYTE lub_InputOutput, T_UBYTE lub_OpenDrain);

void HAL_Led_Init(void);

void HAL_Led_TurnOn(T_UBYTE lub_Led);
void HAL_Led_TurnOff(T_UBYTE lub_Led);

void HAL_Led_IsWindowClose(PTR_UBYTE lpub_Close);
void HAL_Led_IsWindowOpen(PTR_UBYTE lpub_Open);
void HAL_Led_WindowStill(void);
void HAL_Led_CloseNext(void);
void HAL_Led_OpenNext(void);
void HAL_Led_Init400ms(void);
void HAL_Led_HasCounted400ms(PTR_UBYTE lpub_Count400ms);


void HAL_Timer_HasCounted5s(PTR_UBYTE lpub_Timer5s);
void HAL_Timer_Init5s(void);

#endif